import { ref } from 'vue'
import { defineStore } from 'pinia'
import { StoresKey } from '@/common/constants'

export const userSettingsStore = defineStore(
  StoresKey.SETTINGS,
  () => {
    const menuPostion = ref('top')

    const setMenuPostion = (value: 'top' | 'left') => {
      menuPostion.value = value
      console.debug('menuPostion', menuPostion.value)
    }
    return { menuPostion, setMenuPostion }
  },
  {
    persist: {
      key: StoresKey.SETTINGS,
      storage: localStorage
    }
  }
)
